import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SkReportVO, SkReportForm, SkReportQuery } from '@/api/app/SkReport/types';

/**
 * 查询举报信息列表
 * @param query
 * @returns {*}
 */

export const listSkReport = (query?: SkReportQuery): AxiosPromise<SkReportVO[]> => {
  return request({
    url: '/app/SkReport/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询举报信息详细
 * @param id
 */
export const getSkReport = (id: string | number): AxiosPromise<SkReportVO> => {
  return request({
    url: '/app/SkReport/' + id,
    method: 'get'
  });
};

/**
 * 新增举报信息
 * @param data
 */
export const addSkReport = (data: SkReportForm) => {
  return request({
    url: '/app/SkReport',
    method: 'post',
    data: data
  });
};

/**
 * 修改举报信息
 * @param data
 */
export const updateSkReport = (data: SkReportForm) => {
  return request({
    url: '/app/SkReport',
    method: 'put',
    data: data
  });
};

/**
 * 删除举报信息
 * @param id
 */
export const delSkReport = (id: string | number | Array<string | number>) => {
  return request({
    url: '/app/SkReport/' + id,
    method: 'delete'
  });
};
